<?php
class Magicien extends Personnage {
	
	public function lancerUnSort(Personnage $perso) {

		$degat = $this->degats;
		$atout = $this->atout;
		
	switch ($degat) {
		case $degat >= 0 && $degat <= 25 : $atout = 4; break;
		case $degat > 25 && $degat <= 50 : $atout = 3; break;
		case $degat > 50 && $degat <= 75 : $atout = 2; break;
		case $degat > 75 && $degat <= 90 : $atout = 1; break;
		default : $atout = 0;
	}
	
	if ($perso->id == $this->id) {
		return self::CEST_MOI;
	}
	
	if ($atout == 0) {
		return self::PAS_DE_MAGIE;
	}
	
	if ($this->estEndormi()) {
		return self::PERSO_ENDORMI;
	}
	
	$perso->timeEndormi = time() + ($atout * 6) * 3600;
	
	return self::PERSONNAGE_ENSORCELE;
	

	}
}





?>